const mongoose = require('mongoose');
const { order } = require("./data/order.js")
const Schema = mongoose.Schema;
// 创建数据结构
const orderSchema = new Schema({
    movieImg: String,//电影图片
    moveName: String,//电影名
    cinemaName: String, //影院名
    theater: String,//放映厅
    displayName: String,//几排几号
    showDate: String,//日期
    showTime: String,//时间
    price: String,//价格
    nowdateTime: String,//现在时间
    username:String,//用户
})
 const orderModel =mongoose.model("order",orderSchema,"order");
 mongoose.connect("mongodb://tangzhenhua:Lovo123456@182.92.214.223:8084/maiwenjie",
 {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    auth: { authSource: "admin" }
  },
 async () => {
    // 当连接成功后触发
    // 创建学生数据 一个（对象）或多个（数组）
    await orderModel.create(order)
})